
import java.util.Scanner;

public class test2 {
    public static void main(String[] args) {
        //最大子数组之和
		Scanner scanner = new Scanner(System.in);

		System.out.println("输入数组的长度：");
		int length = scanner.nextInt();
		int[] nums = new int[length];

		System.out.println("输入" + length + "个数组元素：");
		for (int i = 0; i < length; i++) {
			nums[i] = scanner.nextInt();
		}
        int maxSum = MaxSubArraySum.maxSubArray(nums);
		System.out.println("子数组之和的最大值为：" + maxSum);
		scanner.close();
    }
}
